package com.hxzy.controller;

import com.hxzy.pojo.Address;
import com.hxzy.pojo.Result;
import com.hxzy.pojo.StatusCode;
import com.hxzy.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/address")
public class AddressController {
    @Autowired
    private AddressService addressService;

    @RequestMapping("/orderUser")
    public Result orderUser(String username,String vo){
        /*
        * String token = vo.getToken
        *   Map  map  = TokenDecode.getUserInfo(token)
        *   String username  = map.get("username");
        * */
        List<Address> list = addressService.list(username);
        return new Result(true, StatusCode.OK,"查询成功",list);
    }

}
